<%-- 
    Document   : index
    Created on : 1 Dec, 2011, 11:35:13 AM
    Author     : vignesh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <script src="DHTMLX/dhtmlxWindows/codebase/dhtmlxcommon.js"></script>
                <script src="JQUERY/jquery.js"></script>


    </head>
    <body>
        <script>
            
            
            function outputResponse(loader) {
                if (loader.xmlDoc.responseXML != null)
                    alert("We Got Response\n\n" + loader.doSerialization() + loader.xmlDoc.responseText + loader.xmlDoc.responseXML);
                else
                    alert("Response contains no XML");
            }
            function sendRequestGet() {
                if (!document.getElementById('sync').checked) {
                    dhtmlxAjax.get("ajax.jsp?" + document.getElementById('params').value, outputResponse);
                    alert("Request Sent");
                } else {
                    var loader = dhtmlxAjax.getSync("ajax.jsp?" + encodeURI(document.getElementById('params').value));
                    alert("Request Sent");
                    outputResponse(loader);
                }
            }
            
            $(document).ready(function(){
            $("button").click(function(){
                $.ajax({url:"ajax.jsp?" + encodeURI(document.getElementById('params').value),success:function(result){
                $("div").html(result);
                }});
            });});
            
        </script>


        <h3>Parameters: <input type="text" value="param1=value&param2=value" id="params" style="width:300px;">&nbsp;
            <button >GET</button>
            <input type="checkbox" id="sync"> Use Synchronous Mode</h3>
            
        <div></div>

    </body>
</html>
